Intra prediction modes for use in an AVC/H.264 encoding method, each of which can be set in an intra prediction processes carried out by a moving image encoding device, will be explained. One intra prediction mode for luminance can be selected for each block unit from among a plurality of prediction modes. FIG. 15 is an explanatory drawing showing intra prediction modes in the case of a 4×4 pixel block size for luminance. In the case of a 4×4 pixel block size for luminance, nine intra prediction modes including a mode 0 to a mode 8 are defined.
In the example of FIG. 15, each white circle shows a pixel in a block to be encoded, and each black circle shows a pixel that is used for prediction, and that exists in an already-encoded adjacent block. The mode 2 is an intra prediction mode associated with an average prediction in which each pixel in the target block to be encoded is predicted by using the average of adjacent pixels existing in the upper and left blocks. The modes other than the mode 2 are intra prediction modes associated with a directional prediction.
The mode 0 is an intra prediction mode associated with a vertical prediction in which adjacent pixels in the upper block are repeatedly replicated to create plural rows of pixels along a vertical direction to generate a prediction image. For example, the mode 0 is selected when the target block to be encoded is a vertically striped pattern. Further, the mode 1 is an intra prediction mode associated with a horizontal prediction in which adjacent pixels in the left block are repeatedly replicated to create plural columns of pixels along a horizontal direction to generate a prediction image. In each of the modes 3 to 8, interpolation pixels running in a predetermined direction (i.e., a direction shown by arrows) are generated by using the adjacent pixels in the upper block or the left block to generate a prediction image.
In this case, the block size for luminance to which an intra prediction is applied can be selected from 4×4 pixels, 8×8 pixels, and 16×16 pixels. In the case of 8×8 pixels, nine intra prediction modes are defined, like in the case of 4×4 pixels. In contrast with this, in the case of 16×16 pixels, four intra prediction modes which are called plane predictions are defined in addition to intra prediction modes associated with an average prediction, a vertical prediction, and a horizontal prediction. Each intra prediction mode associated with a plane prediction is a mode in which pixels created by carrying out an interpolation in a diagonal direction on the adjacent pixels in the upper block and the adjacent pixels in the left block are provided as predicted values.
In a directional prediction mode in the case of a block size of 4×4 pixels or 8×8 pixels, because predicted values are generated along a predetermined direction (e.g., a direction of 45 degrees), the prediction efficiency increases and the code amount can be reduced when the direction of a boundary (edge) of an object in a block matches the direction shown by the prediction mode. However, when the direction of an edge of an object in a block does not match the direction shown by the prediction mode, the code amount cannot be reduced because the prediction efficiency decreases. The following patent reference 1 discloses a technology capable of reducing the code amount related to intra prediction modes by simply using a frequency information table for storing the counted frequency of occurrence of an intra prediction mode. However, it is necessary to prepare the frequency information table in advance.